#include "cuda_runtime.h"
#include "device_launch_parameters.h"

#include <stdio.h>

#ifndef CUDACOMMON
#define CUDACOMMON

inline void CudaCheckError() {
  // ask CUDA for the last error to occur (if one exists)
  cudaError_t error = cudaGetLastError();
  if(error != cudaSuccess)
  {
    // something's gone wrong
    // print out the CUDA error as a string
    printf("CUDA Error: %s\n", cudaGetErrorString(error));

    // we can't recover from the error -- exit the program
    //return 1;
  }
}

#endif
